package com.marmot.cloud.framework.orm.jpa.entity;


import com.marmot.cloud.framework.orm.jpa.comment.annotation.Comment;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;


@Data
@MappedSuperclass
@EqualsAndHashCode(callSuper=true)
@EntityListeners(AuditingEntityListener.class)
public abstract class BasePkJpaEntity extends BaseEntity {

    @Id
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "org.hibernate.id.UUIDGenerator")
    @Column(length = 36)
    @Comment(value = "主键")
    public String id;
}
